<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title>
  Hantsy
  
  Bai
  
  
  | Deploying Jakarta EE 9 applications to WildFly
  
</title>
<meta name="description" content="My personal website focusing on Java EE/Jakarta EE and Spring.
">

<!-- Open Graph -->


<!-- Bootstrap & MDB -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
  rel="stylesheet" integrity="sha512-MoRNloxbStBcD8z3M/2BmnT+rg4IsMxPkXaGh2zD6LGNNFE80W3onsAhRcMAMrSoyWL9xD7Ert0men7vR8LUZg==" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.19.1/css/mdb.min.css"
  integrity="sha512-RO38pBRxYH3SoOprtPTD86JFOclM51/XTIdEPh5j8sj4tp8jmQIx26twG52UaLi//hQldfrh7e51WzP9wuP32Q==" crossorigin="anonymous" />

<!-- Fonts & Icons -->
<link rel="stylesheet"
  href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css"
  integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog==" crossorigin="anonymous">
<link rel="stylesheet"
  href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.9.0/css/academicons.min.css"
  integrity="sha512-W4yqoT1+8NLkinBLBZko+dFB2ZbHsYLDdr50VElllRcNt2Q4/GSs6u71UHKxB7S6JEMCp5Ve4xjh3eGQl/HRvg==" crossorigin="anonymous">
<link rel="stylesheet" type="text/css"
  href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Roboto+Slab:100,300,400,500,700|Material+Icons">

<!-- Code Syntax Highlighting -->
<link rel="stylesheet"
  href="https://gitcdn.link/repo/jwarby/jekyll-pygments-themes/master/github.css" />

<!-- Styles -->
<link rel="shortcut icon" href="/assets/img/favicon.ico">
<link rel="stylesheet" href="/assets/css/main.css">

<link rel="canonical" href="/blog/2020/deploying-jakarta-ee-9-applications-to-wildfly/">

<!-- JQuery -->
<!-- jQuery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>


<!-- Theming-->

<script src="/assets/js/theme.js"></script>
<!-- Load DarkMode JS -->
<script src="/assets/js/dark_mode.js"></script>



<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-18SZ2W3GXD"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag() { dataLayer.push(arguments); }
  gtag('js', new Date());

  gtag('config', 'G-18SZ2W3GXD');
</script>




  
<!-- MathJax -->
<script type="text/javascript">
  window.MathJax = {
    tex: {
      tags: 'ams'
    }
  };
</script>
<script defer type="text/javascript" id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax@3.1.2/es5/tex-mml-chtml.js"></script>
<script defer src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>


  <link type="application/atom+xml" rel="alternate" href="/feed.xml" title="blank" />
  <!-- Begin Jekyll SEO tag v2.7.1 -->
<meta name="generator" content="Jekyll v3.9.0" />
<meta property="og:title" content="Deploying Jakarta EE 9 applications to WildFly" />
<meta property="og:locale" content="en_US" />
<meta name="description" content="WildFly 22.0.0.Alph1 provides a standalone preview distribution for Jakarta EE 9. Prerequisites Make sure you have installed the following software. Java 8 or Java 11Apache Maven 3.6WildFly 22.0.0.Alpha1 Jakarta EE 9 preview Go to the WildFly Download page, and make sure you are downloading the Jakarta EE 9 preview version. Get the source codes from my github. Manual deployment Clone the source codes from my github account, and then build the project. mvn clean package When it is done, there is a jakartaee9-starter-boilerplate.war file packaged in the target folder. Extract the WildFly files into your local disk, enter the WildFly folder, and start the WildFly server . # cd [wildfly-preview-22.0.0.Alpha1 install dir]\bin # standalone.batCalling &quot;D:\appsvr\wildfly-preview-22.0.0.Alpha1\bin\standalone.conf.bat&quot;Setting JAVA property to &quot;D:\jdk11\bin\java&quot;=============================================================================== JBoss Bootstrap Environment JBOSS_HOME: &quot;D:\appsvr\wildfly-preview-22.0.0.Alpha1&quot; JAVA: &quot;D:\jdk11\bin\java&quot; JAVA_OPTS: &quot;-client -Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED&quot; =============================================================================== ... 14:06:11,863 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990 Here I executed the traditional batch command in Windows CMD. Please use standalone.ps1 instead when you are using a Windows PowerShell, or standalone.sh when using a Linux like terminal. To deploy our application, just copy the war to the wildfly-preview-22.0.0.Alpha1 dir/standalone/deployments folder. It will perform an deployment automatically, and generates a .deployed file to indicate the deployment status is accomplished. To undeploy the application, just remove the war file from the wildfly-preview-22.0.0.Alpha1 dir/standalone/deployments folder. It will generate a .undeployed file to indicate the undeploy action is done successfully. Using WildFly maven plugin Declare a wildfly-maven-plugin configuration under build/plugins section in the project pom.xml file. &lt;plugin&gt; &lt;groupId&gt;org.wildfly.plugins&lt;/groupId&gt; &lt;artifactId&gt;wildfly-maven-plugin&lt;/artifactId&gt; &lt;version&gt;${wildfly-maven-plugin.version}&lt;/version&gt; &lt;/plugin&gt; Simply run the following command to deploy the application to WildFly server. mvn clean package wildfly:run -Dwildfly.version=22.0.0.Alpha1 -Dwildfly.artifactId=wildfly-preview-dist NOTE: You have to specify wildfly-preview-dist as artifact id to pick up the Jakarta EE 9 preview version. If it is not set, it will choose wildfly-dist which is Jakarta EE 8 compatible. The wildfly-maven-plugin manages lifecycle of the WildFly server here, it will try to download and prepare a copy of WildFly server for this application, and start it, and then deploy the application to the WildFly server. If you wan to reuse the existing WildFly server in your machine, configure a jboss-as.home or jbossHome property in the plugin&#39;s configuration section. &lt;configuration&gt; &lt;!-- if a jboss-as.home or jboss.home property is not present, firstly it will download a copy of wildfly distribution automatically --&gt; &lt;!-- &lt;jossHome&gt;&lt;/jbossHome&gt;--&gt; ... Or append a jboss-as.home parameter to run the wildfly:run goal. mvn clean package wildfly:run -Djboss-as.home=[ the path of wildfly-preview-22.0.0.Alpha1 install dir] If you wan to deploy the application to a running WildFly server, esp the WildFly server is located in a remote host. Configure hostname, port, and admin account info of the WildFly server in the configuration. &lt;configuration&gt; &lt;!-- To deploy a running wildfly server --&gt; &lt;hostname&gt;&lt;/hostname&gt; &lt;port&gt;&lt;/port&gt; &lt;username&gt;&lt;/username&gt; &lt;password&gt;&lt;/password&gt; ... Using the following command to deploy and undeploy the application. # deploy applicationsmvn clean package wildfly:deploy # undeploy mvn wildfly:undeploy In the server log of the running WildFly server, you can see the deploy and undeploy progress like the following. 15:07:20,568 INFO [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0001: Content added at location D:\appsvr\wildfly-preview-22.0.0.Alpha1\standalone\data\content\9b\8908496997cd79b1bfa229ef2a24107315b429\content15:07:20,568 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of &quot;jakartaee9-starter-boilerplate.war&quot; (runtime-name: &quot;jakartaee9-starter-boilerplate.war&quot;)15:07:25,093 INFO [org.jboss.weld.deployer] (MSC service thread 1-4) WFLYWELD0003: Processing weld deployment jakartaee9-starter-boilerplate.war15:07:25,165 INFO [io.jaegertracing.internal.JaegerTracer] (MSC service thread 1-4) No shutdown hook registered: Please call close() manually on application shutdown.15:07:25,250 INFO [io.smallrye.metrics] (MSC service thread 1-6) MicroProfile: Metrics activated (SmallRye Metrics version: 2.4.4)15:07:25,438 INFO [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 87) RESTEASY002225: Deploying jakarta.ws.rs.core.Application: class com.example.JaxrsActivator$Proxy$_$$_WeldClientProxy15:07:25,438 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 87) WFLYUT0021: Registered web context: &#39;/jakartaee9-starter-boilerplate&#39; for server &#39;default-server&#39;15:07:25,469 INFO [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0010: Deployed &quot;jakartaee9-starter-boilerplate.war&quot; (runtime-name : &quot;jakartaee9-starter-boilerplate.war&quot;)15:07:36,538 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 87) WFLYUT0022: Unregistered web context: &#39;/jakartaee9-starter-boilerplate&#39; from server &#39;default-server&#39; // starting a undeployment15:07:36,569 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0028: Stopped deployment jakartaee9-starter-boilerplate.war (runtime-name: jakartaee9-starter-boilerplate.war) in 47ms15:07:36,616 INFO [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0002: Content removed from location D:\appsvr\wildfly-preview-22.0.0.Alpha1\standalone\data\content\9b\8908496997cd79b1bfa229ef2a24107315b429\content15:07:36,616 INFO [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0009: Undeployed &quot;jakartaee9-starter-boilerplate.war&quot; (runtime-name: &quot;jakartaee9-starter-boilerplate.war&quot;) For security consideration, you can configure these sensitive info, such as username , password , etc. under the server section in your local Maven settings(~/.m2/settings.xml), and refer it by id in the configuration. &lt;configuration&gt; &lt;!-- or set a wildfly.id property to add a server in settings.xml --&gt; &lt;!--&lt;id&gt;wildfly-svr&lt;/id&gt; --&gt;&lt;/configuration&gt; &lt;hr&gt;&lt;p&gt;Deploying Jakarta EE 9 applications to WildFly was originally published in ITNEXT on Medium, where people are continuing the conversation by highlighting and responding to this story.&lt;/p&gt;" />
<meta property="og:description" content="WildFly 22.0.0.Alph1 provides a standalone preview distribution for Jakarta EE 9. Prerequisites Make sure you have installed the following software. Java 8 or Java 11Apache Maven 3.6WildFly 22.0.0.Alpha1 Jakarta EE 9 preview Go to the WildFly Download page, and make sure you are downloading the Jakarta EE 9 preview version. Get the source codes from my github. Manual deployment Clone the source codes from my github account, and then build the project. mvn clean package When it is done, there is a jakartaee9-starter-boilerplate.war file packaged in the target folder. Extract the WildFly files into your local disk, enter the WildFly folder, and start the WildFly server . # cd [wildfly-preview-22.0.0.Alpha1 install dir]\bin # standalone.batCalling &quot;D:\appsvr\wildfly-preview-22.0.0.Alpha1\bin\standalone.conf.bat&quot;Setting JAVA property to &quot;D:\jdk11\bin\java&quot;=============================================================================== JBoss Bootstrap Environment JBOSS_HOME: &quot;D:\appsvr\wildfly-preview-22.0.0.Alpha1&quot; JAVA: &quot;D:\jdk11\bin\java&quot; JAVA_OPTS: &quot;-client -Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED&quot; =============================================================================== ... 14:06:11,863 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990 Here I executed the traditional batch command in Windows CMD. Please use standalone.ps1 instead when you are using a Windows PowerShell, or standalone.sh when using a Linux like terminal. To deploy our application, just copy the war to the wildfly-preview-22.0.0.Alpha1 dir/standalone/deployments folder. It will perform an deployment automatically, and generates a .deployed file to indicate the deployment status is accomplished. To undeploy the application, just remove the war file from the wildfly-preview-22.0.0.Alpha1 dir/standalone/deployments folder. It will generate a .undeployed file to indicate the undeploy action is done successfully. Using WildFly maven plugin Declare a wildfly-maven-plugin configuration under build/plugins section in the project pom.xml file. &lt;plugin&gt; &lt;groupId&gt;org.wildfly.plugins&lt;/groupId&gt; &lt;artifactId&gt;wildfly-maven-plugin&lt;/artifactId&gt; &lt;version&gt;${wildfly-maven-plugin.version}&lt;/version&gt; &lt;/plugin&gt; Simply run the following command to deploy the application to WildFly server. mvn clean package wildfly:run -Dwildfly.version=22.0.0.Alpha1 -Dwildfly.artifactId=wildfly-preview-dist NOTE: You have to specify wildfly-preview-dist as artifact id to pick up the Jakarta EE 9 preview version. If it is not set, it will choose wildfly-dist which is Jakarta EE 8 compatible. The wildfly-maven-plugin manages lifecycle of the WildFly server here, it will try to download and prepare a copy of WildFly server for this application, and start it, and then deploy the application to the WildFly server. If you wan to reuse the existing WildFly server in your machine, configure a jboss-as.home or jbossHome property in the plugin&#39;s configuration section. &lt;configuration&gt; &lt;!-- if a jboss-as.home or jboss.home property is not present, firstly it will download a copy of wildfly distribution automatically --&gt; &lt;!-- &lt;jossHome&gt;&lt;/jbossHome&gt;--&gt; ... Or append a jboss-as.home parameter to run the wildfly:run goal. mvn clean package wildfly:run -Djboss-as.home=[ the path of wildfly-preview-22.0.0.Alpha1 install dir] If you wan to deploy the application to a running WildFly server, esp the WildFly server is located in a remote host. Configure hostname, port, and admin account info of the WildFly server in the configuration. &lt;configuration&gt; &lt;!-- To deploy a running wildfly server --&gt; &lt;hostname&gt;&lt;/hostname&gt; &lt;port&gt;&lt;/port&gt; &lt;username&gt;&lt;/username&gt; &lt;password&gt;&lt;/password&gt; ... Using the following command to deploy and undeploy the application. # deploy applicationsmvn clean package wildfly:deploy # undeploy mvn wildfly:undeploy In the server log of the running WildFly server, you can see the deploy and undeploy progress like the following. 15:07:20,568 INFO [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0001: Content added at location D:\appsvr\wildfly-preview-22.0.0.Alpha1\standalone\data\content\9b\8908496997cd79b1bfa229ef2a24107315b429\content15:07:20,568 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of &quot;jakartaee9-starter-boilerplate.war&quot; (runtime-name: &quot;jakartaee9-starter-boilerplate.war&quot;)15:07:25,093 INFO [org.jboss.weld.deployer] (MSC service thread 1-4) WFLYWELD0003: Processing weld deployment jakartaee9-starter-boilerplate.war15:07:25,165 INFO [io.jaegertracing.internal.JaegerTracer] (MSC service thread 1-4) No shutdown hook registered: Please call close() manually on application shutdown.15:07:25,250 INFO [io.smallrye.metrics] (MSC service thread 1-6) MicroProfile: Metrics activated (SmallRye Metrics version: 2.4.4)15:07:25,438 INFO [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 87) RESTEASY002225: Deploying jakarta.ws.rs.core.Application: class com.example.JaxrsActivator$Proxy$_$$_WeldClientProxy15:07:25,438 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 87) WFLYUT0021: Registered web context: &#39;/jakartaee9-starter-boilerplate&#39; for server &#39;default-server&#39;15:07:25,469 INFO [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0010: Deployed &quot;jakartaee9-starter-boilerplate.war&quot; (runtime-name : &quot;jakartaee9-starter-boilerplate.war&quot;)15:07:36,538 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 87) WFLYUT0022: Unregistered web context: &#39;/jakartaee9-starter-boilerplate&#39; from server &#39;default-server&#39; // starting a undeployment15:07:36,569 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0028: Stopped deployment jakartaee9-starter-boilerplate.war (runtime-name: jakartaee9-starter-boilerplate.war) in 47ms15:07:36,616 INFO [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0002: Content removed from location D:\appsvr\wildfly-preview-22.0.0.Alpha1\standalone\data\content\9b\8908496997cd79b1bfa229ef2a24107315b429\content15:07:36,616 INFO [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0009: Undeployed &quot;jakartaee9-starter-boilerplate.war&quot; (runtime-name: &quot;jakartaee9-starter-boilerplate.war&quot;) For security consideration, you can configure these sensitive info, such as username , password , etc. under the server section in your local Maven settings(~/.m2/settings.xml), and refer it by id in the configuration. &lt;configuration&gt; &lt;!-- or set a wildfly.id property to add a server in settings.xml --&gt; &lt;!--&lt;id&gt;wildfly-svr&lt;/id&gt; --&gt;&lt;/configuration&gt; &lt;hr&gt;&lt;p&gt;Deploying Jakarta EE 9 applications to WildFly was originally published in ITNEXT on Medium, where people are continuing the conversation by highlighting and responding to this story.&lt;/p&gt;" />
<meta property="og:site_name" content="blank" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2020-11-28T00:00:00+00:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="Deploying Jakarta EE 9 applications to WildFly" />
<script type="application/ld+json">
{"datePublished":"2020-11-28T00:00:00+00:00","description":"WildFly 22.0.0.Alph1 provides a standalone preview distribution for Jakarta EE 9. Prerequisites Make sure you have installed the following software. Java 8 or Java 11Apache Maven 3.6WildFly 22.0.0.Alpha1 Jakarta EE 9 preview Go to the WildFly Download page, and make sure you are downloading the Jakarta EE 9 preview version. Get the source codes from my github. Manual deployment Clone the source codes from my github account, and then build the project. mvn clean package When it is done, there is a jakartaee9-starter-boilerplate.war file packaged in the target folder. Extract the WildFly files into your local disk, enter the WildFly folder, and start the WildFly server . # cd [wildfly-preview-22.0.0.Alpha1 install dir]\\bin # standalone.batCalling &quot;D:\\appsvr\\wildfly-preview-22.0.0.Alpha1\\bin\\standalone.conf.bat&quot;Setting JAVA property to &quot;D:\\jdk11\\bin\\java&quot;=============================================================================== JBoss Bootstrap Environment JBOSS_HOME: &quot;D:\\appsvr\\wildfly-preview-22.0.0.Alpha1&quot; JAVA: &quot;D:\\jdk11\\bin\\java&quot; JAVA_OPTS: &quot;-client -Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED&quot; =============================================================================== ... 14:06:11,863 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990 Here I executed the traditional batch command in Windows CMD. Please use standalone.ps1 instead when you are using a Windows PowerShell, or standalone.sh when using a Linux like terminal. To deploy our application, just copy the war to the wildfly-preview-22.0.0.Alpha1 dir/standalone/deployments folder. It will perform an deployment automatically, and generates a .deployed file to indicate the deployment status is accomplished. To undeploy the application, just remove the war file from the wildfly-preview-22.0.0.Alpha1 dir/standalone/deployments folder. It will generate a .undeployed file to indicate the undeploy action is done successfully. Using WildFly maven plugin Declare a wildfly-maven-plugin configuration under build/plugins section in the project pom.xml file. &lt;plugin&gt; &lt;groupId&gt;org.wildfly.plugins&lt;/groupId&gt; &lt;artifactId&gt;wildfly-maven-plugin&lt;/artifactId&gt; &lt;version&gt;${wildfly-maven-plugin.version}&lt;/version&gt; &lt;/plugin&gt; Simply run the following command to deploy the application to WildFly server. mvn clean package wildfly:run -Dwildfly.version=22.0.0.Alpha1 -Dwildfly.artifactId=wildfly-preview-dist NOTE: You have to specify wildfly-preview-dist as artifact id to pick up the Jakarta EE 9 preview version. If it is not set, it will choose wildfly-dist which is Jakarta EE 8 compatible. The wildfly-maven-plugin manages lifecycle of the WildFly server here, it will try to download and prepare a copy of WildFly server for this application, and start it, and then deploy the application to the WildFly server. If you wan to reuse the existing WildFly server in your machine, configure a jboss-as.home or jbossHome property in the plugin&#39;s configuration section. &lt;configuration&gt; &lt;!-- if a jboss-as.home or jboss.home property is not present, firstly it will download a copy of wildfly distribution automatically --&gt; &lt;!-- &lt;jossHome&gt;&lt;/jbossHome&gt;--&gt; ... Or append a jboss-as.home parameter to run the wildfly:run goal. mvn clean package wildfly:run -Djboss-as.home=[ the path of wildfly-preview-22.0.0.Alpha1 install dir] If you wan to deploy the application to a running WildFly server, esp the WildFly server is located in a remote host. Configure hostname, port, and admin account info of the WildFly server in the configuration. &lt;configuration&gt; &lt;!-- To deploy a running wildfly server --&gt; &lt;hostname&gt;&lt;/hostname&gt; &lt;port&gt;&lt;/port&gt; &lt;username&gt;&lt;/username&gt; &lt;password&gt;&lt;/password&gt; ... Using the following command to deploy and undeploy the application. # deploy applicationsmvn clean package wildfly:deploy # undeploy mvn wildfly:undeploy In the server log of the running WildFly server, you can see the deploy and undeploy progress like the following. 15:07:20,568 INFO [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0001: Content added at location D:\\appsvr\\wildfly-preview-22.0.0.Alpha1\\standalone\\data\\content\\9b\\8908496997cd79b1bfa229ef2a24107315b429\\content15:07:20,568 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of &quot;jakartaee9-starter-boilerplate.war&quot; (runtime-name: &quot;jakartaee9-starter-boilerplate.war&quot;)15:07:25,093 INFO [org.jboss.weld.deployer] (MSC service thread 1-4) WFLYWELD0003: Processing weld deployment jakartaee9-starter-boilerplate.war15:07:25,165 INFO [io.jaegertracing.internal.JaegerTracer] (MSC service thread 1-4) No shutdown hook registered: Please call close() manually on application shutdown.15:07:25,250 INFO [io.smallrye.metrics] (MSC service thread 1-6) MicroProfile: Metrics activated (SmallRye Metrics version: 2.4.4)15:07:25,438 INFO [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 87) RESTEASY002225: Deploying jakarta.ws.rs.core.Application: class com.example.JaxrsActivator$Proxy$_$$_WeldClientProxy15:07:25,438 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 87) WFLYUT0021: Registered web context: &#39;/jakartaee9-starter-boilerplate&#39; for server &#39;default-server&#39;15:07:25,469 INFO [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0010: Deployed &quot;jakartaee9-starter-boilerplate.war&quot; (runtime-name : &quot;jakartaee9-starter-boilerplate.war&quot;)15:07:36,538 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 87) WFLYUT0022: Unregistered web context: &#39;/jakartaee9-starter-boilerplate&#39; from server &#39;default-server&#39; // starting a undeployment15:07:36,569 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0028: Stopped deployment jakartaee9-starter-boilerplate.war (runtime-name: jakartaee9-starter-boilerplate.war) in 47ms15:07:36,616 INFO [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0002: Content removed from location D:\\appsvr\\wildfly-preview-22.0.0.Alpha1\\standalone\\data\\content\\9b\\8908496997cd79b1bfa229ef2a24107315b429\\content15:07:36,616 INFO [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0009: Undeployed &quot;jakartaee9-starter-boilerplate.war&quot; (runtime-name: &quot;jakartaee9-starter-boilerplate.war&quot;) For security consideration, you can configure these sensitive info, such as username , password , etc. under the server section in your local Maven settings(~/.m2/settings.xml), and refer it by id in the configuration. &lt;configuration&gt; &lt;!-- or set a wildfly.id property to add a server in settings.xml --&gt; &lt;!--&lt;id&gt;wildfly-svr&lt;/id&gt; --&gt;&lt;/configuration&gt; &lt;hr&gt;&lt;p&gt;Deploying Jakarta EE 9 applications to WildFly was originally published in ITNEXT on Medium, where people are continuing the conversation by highlighting and responding to this story.&lt;/p&gt;","mainEntityOfPage":{"@type":"WebPage","@id":"/blog/2020/deploying-jakarta-ee-9-applications-to-wildfly/"},"url":"/blog/2020/deploying-jakarta-ee-9-applications-to-wildfly/","@type":"BlogPosting","headline":"Deploying Jakarta EE 9 applications to WildFly","dateModified":"2020-11-28T00:00:00+00:00","@context":"https://schema.org"}</script>
<!-- End Jekyll SEO tag -->

</head>

<body
  class="fixed-top-nav ">

  <!-- Header -->

  <header>

    <!-- Nav Bar -->
    <nav id="navbar" class="navbar navbar-light navbar-expand-sm fixed-top">
    <div class="container">
      
      <a class="navbar-brand title font-weight-lighter" href="/">
       <span class="font-weight-bold">Hantsy</span>   Bai
      </a>
      
      <!-- Navbar Toggle -->
      <button class="navbar-toggler collapsed ml-auto" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar top-bar"></span>
        <span class="icon-bar middle-bar"></span>
        <span class="icon-bar bottom-bar"></span>
      </button>
      <div class="collapse navbar-collapse text-right" id="navbarNav">
        <ul class="navbar-nav ml-auto flex-nowrap">
          <!-- About -->
          <li class="nav-item ">
            <a class="nav-link" href="/">
              about
              
            </a>
          </li>
          
          <!-- Blog -->
          <li class="nav-item active">
            <a class="nav-link" href="/blog/">
              blog
              
            </a>
          </li>
          
          <!-- Other pages -->
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          <li class="nav-item ">
              <a class="nav-link" href="/projects/">
                projects
                
              </a>
          </li>
          
          
          
          <li class="nav-item ">
              <a class="nav-link" href="/publications/">
                publications
                
              </a>
          </li>
          
          
          
          <li class="nav-item ">
              <a class="nav-link" href="/service/">
                service
                
              </a>
          </li>
          
          
          
            <div class = "toggle-container">
              <a id = "light-toggle">
                  <i class="fas fa-moon"></i>
                  <i class="fas fa-sun"></i>
              </a>
            </div>
          
        </ul>
      </div>
    </div>
  </nav>

</header>


  <!-- Content -->

  <div class="container mt-5">
    

<div class="post">

  <header class="post-header">
    <h1 class="post-title">Deploying Jakarta EE 9 applications to WildFly</h1>
    <p class="post-meta">November 28, 2020</p>
  </header>

  <article class="post-content">
    <h4><a href="https://www.wildfly.org/">WildFly 22.0.0.Alph1</a> provides a standalone preview distribution for Jakarta EE 9.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XZgar-TMaqJ9r-ovXsLz_A.png" /></figure><h3>Prerequisites</h3><p>Make sure you have installed the following software.</p><ul><li>Java 8 or Java 11</li><li>Apache Maven 3.6</li><li>WildFly 22.0.0.Alpha1 Jakarta EE 9 preview</li></ul><p>Go to the Wi<a href="https://www.wildfly.org/downloads/">ldFly Download</a> page, and make sure you are downloading the <a href="https://download.jboss.org/wildfly/22.0.0.Alpha1/wildfly-preview-22.0.0.Alpha1.zip">Jakarta EE 9 preview version</a>.</p><p><strong>Get the </strong><a href="https://github.com/hantsy/jakartaee9-starter-boilerplate"><strong>source codes</strong></a><strong> from my github.</strong></p><h3>Manual deployment</h3><p>Clone the <a href="https://github.com/hantsy/jakartaee9-starter-boilerplate">source codes</a> from my github account, and then build the project.</p><pre>mvn clean package</pre><p>When it is done, there is a <em>jakartaee9-starter-boilerplate.war</em> file packaged in the <em>target</em> folder.</p><p>Extract the WildFly files into your local disk, enter the WildFly folder, and start the WildFly server .</p><pre># cd [wildfly-preview-22.0.0.Alpha1 install dir]\bin</pre><pre># standalone.bat<br>Calling &quot;D:\appsvr\wildfly-preview-22.0.0.Alpha1\bin\standalone.conf.bat&quot;<br>Setting JAVA property to &quot;D:\jdk11\bin\java&quot;<br>===============================================================================</pre><pre>  JBoss Bootstrap Environment</pre><pre>  JBOSS_HOME: &quot;D:\appsvr\wildfly-preview-22.0.0.Alpha1&quot;</pre><pre>  JAVA: &quot;D:\jdk11\bin\java&quot;</pre><pre>  JAVA_OPTS: &quot;-client -Dprogram.name=standalone.bat -Xms64M -Xmx512M -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman  --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED&quot;</pre><pre>===============================================================================<br>  ...<br>  14:06:11,863 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on <a href="http://127.0.0.1:9990">http://127.0.0.1:9990</a></pre><p>Here I executed the traditional batch command in Windows CMD. Please use standalone.ps1 instead when you are using a Windows PowerShell, or standalone.sh when using a Linux like terminal.</p><p>To deploy our application, just copy the war to the <em>wildfly-preview-22.0.0.Alpha1 dir/standalone/deployments</em> folder.</p><p>It will perform an deployment automatically, and generates a .deployed file to indicate the deployment status is accomplished.</p><p>To undeploy the application, just remove the war file from the <em>wildfly-preview-22.0.0.Alpha1 dir/standalone/deployments</em> folder. It will generate a .undeployed file to indicate the undeploy action is done successfully.</p><h3>Using WildFly maven plugin</h3><p>Declare a wildfly-maven-plugin configuration under build/plugins section in the project <em>pom.xml</em> file.</p><pre>&lt;plugin&gt;<br>     &lt;groupId&gt;org.wildfly.plugins&lt;/groupId&gt;<br>     &lt;artifactId&gt;wildfly-maven-plugin&lt;/artifactId&gt;<br>     &lt;version&gt;${wildfly-maven-plugin.version}&lt;/version&gt;<br> &lt;/plugin&gt;</pre><p>Simply run the following command to deploy the application to WildFly server.</p><pre>mvn clean package wildfly:run -Dwildfly.version=22.0.0.Alpha1 -Dwildfly.artifactId=wildfly-preview-dist</pre><blockquote><em>NOTE: You have to specify </em><em>wildfly-preview-dist as artifact id to pick up the Jakarta EE 9 preview version. If it is not set, it will choose </em><em>wildfly-dist which is Jakarta EE 8 compatible.</em></blockquote><p>The wildfly-maven-plugin manages lifecycle of the WildFly server here, it will try to download and prepare a copy of WildFly server for this application, and start it, and then deploy the application to the WildFly server.</p><p>If you wan to reuse the existing WildFly server in your machine, configure a jboss-as.home or jbossHome property in the plugin&#39;s configuration section.</p><pre>&lt;configuration&gt;<br>    &lt;!-- if a jboss-as.home or jboss.home property is not present, firstly it will download<br>                            a copy of wildfly distribution automatically --&gt;<br>    &lt;!-- &lt;jossHome&gt;&lt;/jbossHome&gt;--&gt;<br>    ...</pre><p>Or append a jboss-as.home parameter to run the wildfly:run goal.</p><pre>mvn clean package wildfly:run -Djboss-as.home=[ the path of wildfly-preview-22.0.0.Alpha1 install dir]</pre><p>If you wan to deploy the application to a running WildFly server, esp the WildFly server is located in a remote host. Configure hostname, port, and admin account info of the WildFly server in the configuration.</p><pre>&lt;configuration&gt;</pre><pre>    &lt;!-- To deploy a running wildfly server --&gt;<br>    &lt;hostname&gt;&lt;/hostname&gt;<br>    &lt;port&gt;&lt;/port&gt;<br>    &lt;username&gt;&lt;/username&gt;<br>    &lt;password&gt;&lt;/password&gt;<br>    ...</pre><p>Using the following command to deploy and undeploy the application.</p><pre># deploy applications<br>mvn clean package wildfly:deploy</pre><pre># undeploy <br>mvn wildfly:undeploy</pre><p>In the server log of the running WildFly server, you can see the deploy and undeploy progress like the following.</p><pre>15:07:20,568 INFO  [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0001: Content added at location D:\appsvr\wildfly-preview-22.0.0.Alpha1\standalone\data\content\9b\8908496997cd79b1bfa229ef2a24107315b429\content<br>15:07:20,568 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of &quot;jakartaee9-starter-boilerplate.war&quot; (runtime-name: &quot;jakartaee9-starter-boilerplate.war&quot;)<br>15:07:25,093 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) WFLYWELD0003: Processing weld deployment jakartaee9-starter-boilerplate.war<br>15:07:25,165 INFO  [io.jaegertracing.internal.JaegerTracer] (MSC service thread 1-4) No shutdown hook registered: Please call close() manually on application shutdown.<br>15:07:25,250 INFO  [io.smallrye.metrics] (MSC service thread 1-6) MicroProfile: Metrics activated (SmallRye Metrics version: 2.4.4)<br>15:07:25,438 INFO  [org.jboss.resteasy.resteasy_jaxrs.i18n] (ServerService Thread Pool -- 87) RESTEASY002225: Deploying jakarta.ws.rs.core.Application: class com.example.JaxrsActivator$Proxy$_$$_WeldClientProxy<br>15:07:25,438 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 87) WFLYUT0021: Registered web context: &#39;/jakartaee9-starter-boilerplate&#39; for server &#39;default-server&#39;<br>15:07:25,469 INFO  [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0010: Deployed &quot;jakartaee9-starter-boilerplate.war&quot; (runtime-name : &quot;jakartaee9-starter-boilerplate.war&quot;)<br>15:07:36,538 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 87) WFLYUT0022: Unregistered web context: &#39;/jakartaee9-starter-boilerplate&#39; from server &#39;default-server&#39;</pre><pre>// starting a undeployment<br>15:07:36,569 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0028: Stopped deployment jakartaee9-starter-boilerplate.war (runtime-name: jakartaee9-starter-boilerplate.war) in 47ms<br>15:07:36,616 INFO  [org.jboss.as.repository] (management-handler-thread - 1) WFLYDR0002: Content removed from location D:\appsvr\wildfly-preview-22.0.0.Alpha1\standalone\data\content\9b\8908496997cd79b1bfa229ef2a24107315b429\content<br>15:07:36,616 INFO  [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0009: Undeployed &quot;jakartaee9-starter-boilerplate.war&quot; (runtime-name: &quot;jakartaee9-starter-boilerplate.war&quot;)</pre><p>For security consideration, you can configure these sensitive info, such as username , password , etc. under the server section in your local Maven settings(<em>~/.m2/settings.xml</em>), and refer it by id in the configuration.</p><pre>&lt;configuration&gt;<br>    &lt;!-- or set a wildfly.id property to add a server in settings.xml --&gt;<br>    &lt;!--&lt;id&gt;wildfly-svr&lt;/id&gt; --&gt;<br>&lt;/configuration&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e271d1403b2c" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/deploying-jakarta-ee-9-applications-to-wildfly-e271d1403b2c">Deploying Jakarta EE 9 applications to WildFly</a> was originally published in <a href="https://itnext.io">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>

  </article>

  

</div>

  </div>

  <!-- Footer -->

  
<footer class="fixed-bottom">
  <div class="container mt-0">
    &copy; Copyright 2021 Hantsy  Bai.
    <span class="mr-auto"></span>
    Powered by <a href="http://jekyllrb.com/" target="_blank">Jekyll</a> with <a href="https://github.com/alshedivat/al-folio">al-folio</a> theme.

    
    

  </div>
</footer>



</body>

<!-- Bootsrap & MDB scripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.4.4/umd/popper.min.js" integrity="sha512-eUQ9hGdLjBjY3F41CScH3UX+4JDSI9zXeroz7hJ+RteoCaY+GP/LDoM8AO+Pt+DRFw3nXqsjh9Zsts8hnYv8/A==" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha512-M5KW3ztuIICmVIhjSqXe01oV2bpe248gOxqmlcYrEzAvws7Pw3z6BK0iGbrwvdrUQUhi3eXgtxp5I8PDo9YfjQ==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.19.1/js/mdb.min.js" integrity="sha512-Mug9KHKmroQFMLm93zGrjhibM2z2Obg9l6qFG2qKjXEXkMp/VDkI4uju9m4QKPjWSwQ6O2qzZEnJDEeCw0Blcw==" crossorigin="anonymous"></script>


<!-- Mansory & imagesLoaded -->
<script defer src="https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js"></script>
<script defer src="https://unpkg.com/imagesloaded@4/imagesloaded.pkgd.min.js"></script>
<script defer src="/assets/js/mansory.js" type="text/javascript"></script>





<!-- Load Common JS -->
<script src="/assets/js/common.js"></script>


</html>
